home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / demo / tgdemo.exe / TGDEMO4.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-08-04  |  6KB  |  146 lines

  1. Demo4
  2. Demo 4 - Multiple Selection
  3. Form15
  4. Frame1
  5. Combo1
  6. Command2
  7. Execute
  8. Label2
  9. Clicking "Execute" add marks for all records which match the expression below.  Some common expressions are provided in the combo dropdown.
  10. MS Sans Serif
  11. Command1
  12.     Clear All
  13. MarkScroll    
  14. Table1
  15. TgDemo
  16. MS Sans Serif
  17. First
  18. First
  19. Opus.Last
  20. Opus.Last
  21. Country
  22. Country
  23. Data1M
  24. Data1%
  25. dBASE IV;database=.
  26. Sselect * from composer, opus, composer inner join opus on composer.last = opus.last
  27. Composers and Compositions
  28. Line1
  29. Label1
  30. Select records by moving to the left grid margin and clicking.  You can use the scrollbar above to move between records you've selected.
  31. MS Sans Serif
  32.     SelectMsg
  33. No rows are selected.
  34.     Form_Load
  35. Form_Unload
  36. Cancel
  37. QuitCurrentDemo
  38. Command1_Click
  39. Command2_Click
  40. Data1G
  41.     Recordset
  42. Command3_Click
  43. Command4_Click
  44. Command5_Click
  45. Command6_Click
  46. Command7_Click
  47. Table1_Click
  48. UpdateSelectMessageV
  49. Table1
  50. BookmarkCount
  51.     SelectMsg
  52. Caption
  53. Table1_MarkChange
  54. IsMarked
  55. UpdateSelectMesssage
  56. SelectMsg_Clicks
  57. MarkScroll
  58. MarkScroll_Change
  59. Value
  60. Bookmarki
  61. BookmarkList
  62. SetSelectMessage
  63. RecordCount
  64. Frame1_DragDrop
  65. Source
  66. Control
  67. Combo1_Change
  68. dclone
  69. Dynaset
  70. findErr
  71. NoMatch
  72. Quote
  73.     ListCount
  74. Screen
  75. MousePointer
  76.     HOURGLASS
  77. DEFAULT
  78. Command1_Click
  79.  Clear all of the selected rows.  BookmarkList willr
  80.  be empty after BookmarkCount is set to zero.t
  81. Command2_Click
  82.  Loop through the set and find all records which
  83.  match the criteria specified in (Expr.Text).i
  84.  We use a clone so that we don't move the actual
  85.  record position of the displayed data.h
  86.  For each matching record, add the bookmark to the
  87.  bookmarklist of the grid.  The grid will assure that
  88.  these items will be highlighted.  Note that the
  89.  bookmarks of a clone are compatible with the original
  90.  set.  This is ONLY true of clones.e
  91.  If the expression wasn't in the "quickpick" list of
  92.  expressions, then add it.  This isn't really relevant
  93.  to the demo, but just here as a convenience feature.t
  94. Expression Syntax Error
  95. Form_Load
  96.  The Data1 control actually contains a JOINed set of two
  97.  databases.  We perform a refresh and MoveLast or else
  98.  VB3/Access won't know how many records there are (since
  99.  the JOIN won't be completed yet).  This is CORRECTs
  100.  behavior, and the code below is necessary to assure
  101.  that the JOIN completes before we do anything else.
  102.  force RecordCount to update
  103.  We really want to be at the first record when the
  104.  form first pops up.
  105.  Add common items to the combo box
  106. Country = 
  107. Germany
  108. Country = 
  109. France
  110. Country = 
  111. United States
  112. Instr(Opus, 
  113. Symphony
  114. ) > 0
  115. Instr(Opus, 
  116. Sonata
  117. ) > 0
  118. Instr(Opus, 
  119. Concerto
  120. ) > 0
  121. First = 
  122. George
  123. Form_Unload
  124. MarkScroll_Change
  125.  When the scroll bar is moved, we select a bookmark
  126.  from the BookmarkList and set the Data control'sr
  127.  position.  TrueGrid automatically responds and'
  128.  we need tell it nothing.m
  129. Table1_MarkChange
  130.  This event is sent when the user selects (marks) a
  131.  row in the grid, or unmarks one.  The IsMarkeds
  132.  argument specifies what the CURRENT state of the
  133.  row is.  In our case, the UpdateSelectMessage
  134.  routine just displays the new BookmarkCount, so
  135.  we needn't worry about the individual row selected.
  136. UpdateSelectMessage
  137.  A message is displayed below the grid which indicates
  138.  (a) how many rows are marked and (b) how many records
  139.  there are.  This routine keeps that area up tor
  140.  date.
  141. No rows are selected
  142. There is 1 row selected
  143. There are 
  144.  rows selected
  145.  out of 
  146.